package com.yingsheng.bi.hks.template.utils;

import java.io.IOException;
import java.util.Map;

public class JacksonUtils {

    private static final Jackson mapper = new Jackson();

    public static Map<String, Object> json2Map(String jsonStr) {
        try {
            return mapper.json2map(jsonStr);
        } catch (IOException var2) {
            return null;
        }
    }

    public static <T> T json2Obj(String jsonStr, Class<T> clazz) {
        try {
            return mapper.json2pojo(jsonStr, clazz);
        } catch (IOException var3) {
            return null;
        }
    }

    public static String obj2Json(Object obj) {
        try {
            return mapper.obj2json(obj);
        } catch (IOException var2) {
            return null;
        }
    }

    public static <T> T map2Obj(Object map, Class<T> clazz) {
        return mapper.map2pojo(map, clazz);
    }

    public static Map<String, Object> obj2Map(Object obj) {
        return mapper.pojo2map(obj);
    }
}
